package entity;

import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * @Author:zhengbowen
 * @Date: 2025/09/07 15:57
 * @Description:飞行物父类
 */
public class FlyingObject {
    protected BufferedImage image;
    protected int x;
    protected int y;
    protected int width;
    protected int height;
    protected int xSpeed = 10;
    protected int ySpeed = 10;

    public BufferedImage getImage() {
        return image;
    }

    public void setImage(BufferedImage image) {
        this.image = image;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getxSpeed() {
        return xSpeed;
    }

    public void setxSpeed(int xSpeed) {
        this.xSpeed = xSpeed;
    }

    public int getySpeed() {
        return ySpeed;
    }

    public void setySpeed(int ySpeed) {
        this.ySpeed = ySpeed;
    }
    public void draw(Graphics p) {
        p.drawImage(this.image, this.x, this.y, this.width, this.height, null);
    }
}
